    /* global FormData */
    /* global getCookie */
    /* global template */
    /* global proDetails */
    /* global timeToTimestamp visitUrl*/
    var appearanceList = [];
    var imgList = {};
    var list = [];
    var imgPath = '';

    $("#uploaderInput").on("change", function(e) {
        var file = e.target.files[0];
        /* global handlePic*/
        handlePic(file,2160,function(res){
            if (res.code == 0){
                var a = {};
                a.path = res.data.path;
                imgPath = imgPath + res.data.path + "," ;
                list.push(a);
                imgList.list = list;
                imgList.imgPath = imgPath.substring(0, imgPath.length - 1);
                var html = template ('pho', imgList);
                document.getElementById('uploaderFiles').innerHTML = html;
            } else {
                $.toast(res.message, "cancel");
            }
        });
       
    });

    
    // $("#userBirthDate").calendar({
    //     inputReadOnly:false
    //   });
  
   

    function submitAdd(state){
        var shopId = $("#shopId").val();
        var userCardImage = $("#image").val();
        var userName = $("#userName").val();
        var userBirthDate = $("#userBirthDate").val();
        var userGender = $('input[name="userGender"]:checked').val();
        if (shopId == ''){
            $.toast("没有店铺", "cancel");
            return;
        }
        if (typeof userCardImage == 'undefined' || userCardImage == ''){
            $.toast("请上传图片", "cancel");
            return;
        }
        if ( userName == ''){
            $.toast("名称不能为空", "cancel");
            return;
        }
        if (userBirthDate == ''){
            $.toast("出生日期不能为空", "cancel");
            return;
        }
        
       

        var params = {};
        params.id = shopId;
        params.userCardImage = userCardImage;
        params.userName = userName;
        params.userBirthDate = timeToTimestamp(userBirthDate);
        params.userGender = userGender;
        params.token = getCookie('token');

        add(params);
          

    } 

    function add(params){
        $.ajax({
            type:'POST',
            url:"/antique/api/mallShop/manage/update_shop_personal_auth",
            data: params,
            dataType:"json",
            success:function(res){
                if (res.code == 0){
                    visitUrl('/auth_manage',true);
                    $.toast("提交审核");
                 } else {
                    $.toast(res.message, "cancel");
                }
                
            }
        });
    }



